<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<div id="app">
			<span>{{date | fomat('yyyy-MM-dd')}}</span>
		</div>
		<script src="../vue.js"></script>
		<script type="text/javascript">
			var vm = new Vue({
				el: "#app",
				data: {
					date: new Date()
				},
				methods: {
					
				},
				filters: {
					fomat(val, arg) {
						if (arg == 'yyyy-MM-dd') {
							var ret = ''
							ret += val.getFullYear() + '-' + (val.getMonth()+1) + '-' + val.getDate()
							return ret
						}
						return val
					}
				}
			})
		</script>
	</body>
</html>

